package com.itbaizhan.clouddemoproduct.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itbaizhan.clouddemoproduct.domain.Product;
import com.itbaizhan.clouddemoproduct.dto.ProductDto;
import com.itbaizhan.clouddemoproduct.service.ProductService;
import com.itbaizhan.clouddemoproduct.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【tb_product】的数据库操作Service实现
* @createDate 2024-04-25 18:08:50
*/
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product>
    implements ProductService{

    @Autowired
    private ProductMapper productMapper;

    /**
     * 查询所有商品
     * @param productDto
     * @return
     */
    @Override
    public Page<Product> selectProduct(ProductDto productDto) {
        Page<Product> page = new Page<>(productDto.getPageNum(), productDto.getPageSize());
        Page<Product> productPage  = productMapper.selectPage(page, null);
        return productPage;
    }


}




